﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Lrd.Template.Core.Infrastructure.Audits;
using Lrd.Template.Core.Infrastructure.Entity;
using Lrd.Template.Core.Infrastructure.Enums;

namespace Lrd.Template.Core.Infrastructure.EntityHistory
{
    [Description("审计实体信息")]
    [DisableAuditing]
    public abstract class AuditEntityBase<TAuditEntityKey, TAuditKey> : EntityBase<TAuditEntityKey>
      where TAuditEntityKey : IEquatable<TAuditEntityKey>
         where TAuditKey : IEquatable<TAuditKey>
    {

        [Description("实体名字")]
        /// <summary>
        /// 实体名字
        /// </summary>
        public virtual string Name { get; set; }

        [Description("实体编号")]
        /// <summary>
        /// 实体编号
        /// </summary>
        public virtual string EntityKey { get; set; }


        [Description("类型名")]
        /// <summary>
        ///类型名
        /// </summary>
        public virtual string TypeName { get; set; }

        [Description("实体更改类型")]
        /// <summary>
        /// 实体更改类型
        /// </summary>
        public virtual EntityChangeType ChangeType { get; set; }


        [Description("审计信息ID")]
        public virtual TAuditKey AuditedId { get; set; }

        [NotMapped]
        [Description("关联实体")]
        /// <summary>
        ///  关联实体
        /// </summary>
        public virtual object EntityEntry { get; set; }

    }
}
